// pager
var pager = {
	// /satchipro/customerallinfo.do?pageMethod=next&currentPage=1
	action : "",
	currentPage : "",
	getParam : null,
	doTo : function(pageMethod) {
		var url = this.action + "?pageMethod=" + pageMethod + "&currentPage=" + this.currentPage;
		url = url + this.getParam();
		to(url);
	},
	first : function() {
		this.doTo('first');
	},
	last : function() {
		this.doTo('last');
	},
	previous : function() {
		this.doTo('previous');
	},
	next : function() {
		this.doTo('next');
	}
}
// Shop
function Shop(i, n, r) {
	this.id = i;
	this.name = n;
	this.remark = r;
}

// Cookie
function Cookie(name, value, expires){
	if (arguments.length == 1){
		var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
		if(arr != null) return unescape(arr[2]); return null;
	}else if (arguments.length > 1){
		if(value==null){
			var exp = new Date();
			exp.setTime(exp.getTime() - 1);
			var cval=Cookie(name);
			if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
			return;
		}
		var oldValue = Cookie(name);
		if(oldValue!=null && oldValue==value) return;
		if(expires==null) expires = 30;
		var exp  = new Date(); //new Date("December 31, 9998");
		exp.setTime(exp.getTime() + expires*24*60*60*1000);
		document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
}

